#include <iostream>

int main() {
    double A = 0, B = 0, C = 0, D = 0;
    std::cout << "请输入度分秒" << std::endl;
    std::cin >> A >> B >> C;
    if (A >= 0 && B >= 0 && B < 60 && C >= 0 && C < 60) {
        std::cout << A + B / 60.0 + C / 3600.0 << std::endl;
    } else {
        std::cout << "invalid input" << std::endl;
    }
}